
/*
Replication code for:
Dreher, Axel
Lang, Valentin
Rosendorff, B. Peter
Vreeland, James Raymond:
Bilateral or Multilateral? International Financial Flows and the Dirty-Work Hypothesis
Journal of Politics
*/

clear all
version 16

*packages to install
foreach package in interflex  {
  capture which `package'
  if _rc==111 ssc install `package'
}
	
	
*Directory 
cd "/Users/lang/Dropbox/Buying Votes/replication" 	// change relative path to the directory where the files are located

cap mkdir "tables"
cap mkdir "graphs"


*Log file
 log using "dirtywork.log", replace




*FIGURE 1

use "regressiondata.dta", clear

hist voteagainstUSA_cytot if unsc == 1 & p5 == 0 ///
, ylabel(50(50)300,nogrid angle(0)) freq width(1) color(navy) ///
graphregion(color(white)) bgcolor(white)
graph export "graphs/Figure1.png", as(png) replace



*TABLE 1

use "regressiondata.dta", clear

xtreg  lnODAnetdis_USA  unsc   							  	l_lngdppcconst lnpop   yearFE* if  oda == 1 & p5 == 0 , fe cluster(countryid) 
	est store taba1
	estadd local "Dependent" US aid
	estadd local "FE" Yes
	cap drop baselinesample
	cap gen baselinesample = 1 if e(sample)
					
xtreg  lnODAnetdis_USA votedallwithUSA  votednotallwithUSA  		 l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0 , fe cluster(countryid) 
	est store taba2
		estadd local "Dependent" US aid
		estadd local "FE" Yes
			test _b[votedallwithUSA] = _b[votednotallwithUSA]
			estadd scalar pvalue = r(p)
			

xtreg  lnODAnetdis_USA votedallwithUSA  votednotallwithUSA 	l_pctagreeus_unga	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0 , fe cluster(countryid) 
	est store taba3
		estadd local "Dependent" US aid
		estadd local "FE" Yes
			test _b[votedallwithUSA] = _b[votednotallwithUSA]
			estadd scalar pvalue = r(p)
			
				
xtreg  IMFcommitments_lny  unsc   							   							l_lngdppcconst lnpop  pastIMF  yearFE* if  oda == 1 & p5 == 0 , fe cluster(countryid) 
	est store tabb1
		estadd local "Dependent" IMF loans
		estadd local "FE" Yes

xtreg  IMFcommitments_lny votedallwithUSA  votednotallwithUSA   						l_lngdppcconst lnpop pastIMF  yearFE*  if oda == 1 & p5 == 0 , fe cluster(countryid) 
	est store tabb2
	estadd local "Dependent" IMF loans
	estadd local "FE" Yes
			test _b[votedallwithUSA] = _b[votednotallwithUSA]
			estadd scalar pvalue = r(p)

xtreg  IMFcommitments_lny votedallwithUSA  votednotallwithUSA   l_pctagreeus_unga	l_lngdppcconst lnpop pastIMF  yearFE*  if oda == 1 & p5 == 0 , fe cluster(countryid) 
	est store tabb3
	estadd local "Dependent" IMF loans
	estadd local "FE" Yes
			test _b[votedallwithUSA] = _b[votednotallwithUSA]
			estadd scalar pvalue = r(p)
			
xtreg  lnWBlend  unsc   							   						l_lngdppcconst lnpop    yearFE* if  oda == 1 & p5 == 0 , fe cluster(countryid) 
	est store tabc1
		estadd local "Dependent" WB loans
		estadd local "FE" Yes
		
xtreg  lnWBlend votedallwithUSA  votednotallwithUSA   						l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0   , fe cluster(countryid) 
	est store tabc2
	estadd local "Dependent" WB loans
	estadd local "FE" Yes
			test _b[votedallwithUSA] = _b[votednotallwithUSA]
			estadd scalar pvalue = r(p)

xtreg  lnWBlend votedallwithUSA  votednotallwithUSA   	l_pctagreeus_unga		l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0   , fe cluster(countryid) 
	est store tabc3
	estadd local "Dependent" WB loans
	estadd local "FE" Yes
			test _b[votedallwithUSA] = _b[votednotallwithUSA]
			estadd scalar pvalue = r(p)


			
estout taba* tabb* tabc* using "tables/Table1.xls", title("") ///
 replace delimiter(_tab) label noabbrev style(tab) collabels(none) ///
 drop( _cons ) indicate("Year FE = yearFE*")    ///
 order(unsc  votedallwithUSA  votednotallwithUSA  l_pctagreeus_unga) ///
 cells(b(star fmt(3)) se(par([ ]) abs fmt(3))) starlevels(* 0.1 ** 0.05 *** 0.01) ///
 stats(FE N r2 pvalue Dependent, fmt(0 0 3 3 0) label("Country FE" "Observations" "R-squared" "p-value (all with vs. not all with)" "Dependent Variable"))  ///
 mlabels("[1]" "[2]" "[3]" "[4]" "[5]" "[6]" "[7]" "[8]" "[9]") //

 
 
 
 *FIGURE 2
 
 	xtreg lnODAnetdis_USA    c.votedallwithUSA##c.past_aid_dummy  c.votednotallwithUSA##c.past_aid_dummy   		l_lngdppcconst lnpop   yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)  
			margins, dydx(votedallwithUSA) at(past_aid_dummy = (0 (1) 1))
				marginsplot,  level(95) plotopts(color(black) connect(none)) ciopts(color(black)) yline(0, lcolor(maroon)) ylabel(, angle(0) nogrid)  ///
				title(" ", color(black)) ///
				xtitle("Allied" "(US aid recipient in previous period)") ytitle("Effect of UNSC, all with US") graphregion(color(white)) bgcolor(white) ///
				xlabel(0 "no" 1 "yes") xscale(range(-0.2 1.2)) yscale(range(-0.5 1.0))  ylabel(-0.5 (0.5) 1.0)
				graph export "graphs/Figure2A.png", as(png) replace
	

		xtreg IMFcommitments_lny    c.votedallwithUSA##c.past_aid_dummy  c.votednotallwithUSA##c.past_aid_dummy   		l_lngdppcconst lnpop pastIMF yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			margins, dydx(votedallwithUSA) at(past_aid_dummy = (0 (1) 1))
				marginsplot,  level(95) plotopts(color(black) connect(none)) ciopts(color(black)) yline(0, lcolor(maroon)) ylabel(, angle(0) nogrid)  ///
				title(" ", color(black)) ///
				xtitle("Allied" "(US aid recipient in previous period)") ytitle("Effect of UNSC, all with US") graphregion(color(white)) bgcolor(white)  ///
				xlabel(0 "no" 1 "yes") xscale(range(-0.2 1.2)) yscale(range(-0.5 2.5))  ylabel(-0.5 (0.5) 2.0)
				graph export "graphs/Figure2B.png", as(png) replace
			
			
		xtreg lnWBlend    c.votedallwithUSA##c.past_aid_dummy  c.votednotallwithUSA##c.past_aid_dummy   		l_lngdppcconst lnpop yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			margins, dydx(votedallwithUSA) at(past_aid_dummy = (0 (1) 1))
				marginsplot,  level(95) plotopts(color(black) connect(none)) ciopts(color(black)) yline(0, lcolor(maroon)) ylabel(, angle(0) nogrid)  ///
				title(" ", color(black)) ///
				xtitle("Allied" "(US aid recipient in previous period)") ytitle("Effect of UNSC, all with US") graphregion(color(white)) bgcolor(white)  ///
				xlabel(0 "no" 1 "yes") xscale(range(-0.2 1.2)) yscale(range(-0.5 2.5))  ylabel(-0.5 (0.5) 2.0)
				graph export "graphs/Figure2C.png", as(png) replace
				


	*Result reported in Notes to Figure 2: SUR	 

	set matsize 11000

	*US aid vs. IMF:
	sureg (lnODAnetdis_USA   votedallwithUSA  votednotallwithUSA unscall_pastaid unscnotall_pastaid past_aid_dummy		l_lngdppcconst lnpop   				yearFE* i.countryid  if oda == 1 & p5 == 0 ) ///
			(IMFcommitments_lny  votedallwithUSA  votednotallwithUSA unscall_pastaid unscnotall_pastaid past_aid_dummy    l_lngdppcconst lnpop pastIMF  	yearFE* i.countryid  if oda == 1  & p5 == 0 ), isure
		 
		test [lnODAnetdis_USA]_b[unscall_pastaid] = [IMFcommitments_lny]_b[unscall_pastaid]
		di `r(p)' / 2 // reports p-value of one-sided test: 0.004
	
	*US aid vs. WB:
	sureg (lnODAnetdis_USA   votedallwithUSA  votednotallwithUSA unscall_pastaid unscnotall_pastaid past_aid_dummy 		l_lngdppcconst lnpop   				yearFE* i.countryid  if oda == 1 & p5 == 0 ) ///
			(lnWBlend  	votedallwithUSA  votednotallwithUSA unscall_pastaid unscnotall_pastaid past_aid_dummy    l_lngdppcconst lnpop  yearFE* i.countryid  if oda == 1  & p5 == 0 ), isure
	
		test [lnODAnetdis_USA]_b[unscall_pastaid] = [lnWBlend]_b[unscall_pastaid]
		di `r(p)' / 2 // reports p-value of one-sided test: 0.081

					
		
				
 *FIGURE 3
 
 
xtreg lnODAnetdis_USA    c.votedallwithUSA##c.past_unga c.votednotallwithUSA##c.past_unga  		l_lngdppcconst lnpop   yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
margins, dydx(votedallwithUSA) at(past_unga = (0 (0.05) 1))
marginsplot, level(95) title(" ", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US") legend(off) graphregion(color(white)) bgcolor(white)  ///
	ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
	addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
			graph export "graphs/Figure3A.png", replace	

xtreg IMFcommitments_lny  c.votedallwithUSA##c.past_unga c.votednotallwithUSA##c.past_unga  		l_lngdppcconst lnpop pastIMF  yearFE*  if oda == 1  & p5 == 0 , fe cluster(countryid) 
margins, dydx(votedallwithUSA) at(past_unga = (0 (0.05) 1))
marginsplot, level(95) title(" ", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US") legend(off) graphregion(color(white)) bgcolor(white) ///
	ylabel(,nogrid angle(0))  xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
	addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
		graph export "graphs/Figure3B.png", replace 	
	
xtreg lnWBlend  c.votedallwithUSA##c.past_unga c.votednotallwithUSA##c.past_unga  		l_lngdppcconst lnpop  yearFE*  if oda == 1  & p5 == 0 , fe cluster(countryid) 
margins, dydx(votedallwithUSA) at(past_unga = (0 (0.05) 1))
marginsplot, level(95) title(" ", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US") legend(off) graphregion(color(white)) bgcolor(white) ///
	ylabel(,nogrid angle(0))  xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
	addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
	graph export "graphs/Figure3C.png", replace 	

	

	*Result reported in Notes to Figure 3: SUR	 
	
	set matsize 11000
	
	*US aid vs. IMF:
	sureg (lnODAnetdis_USA   votedallwithUSA  votednotallwithUSA unscall_pastunga unscnotallXpastunga past_unga		l_lngdppcconst lnpop   				yearFE* i.countryid  if oda == 1 & p5 == 0 ) ///
			(IMFcommitments_lny  votedallwithUSA  votednotallwithUSA unscall_pastunga unscnotallXpastunga past_unga    l_lngdppcconst lnpop pastIMF  	yearFE* i.countryid  if oda == 1  & p5 == 0 ), isure
		 
		test [lnODAnetdis_USA]_b[unscall_pastunga] = [IMFcommitments_lny]_b[unscall_pastunga]
		di `r(p)' / 2 // This reports the p-value of a one-sided test: 0.0005
	
	*US aid vs. WB:
	sureg (lnODAnetdis_USA   votedallwithUSA  votednotallwithUSA unscall_pastunga unscnotallXpastunga past_unga		l_lngdppcconst lnpop   				yearFE* i.countryid  if oda == 1 & p5 == 0 ) ///
			(lnWBlend  	votedallwithUSA  votednotallwithUSA unscall_pastunga unscnotallXpastunga past_unga    l_lngdppcconst lnpop  yearFE* i.countryid  if oda == 1  & p5 == 0 ), isure
	
		test [lnODAnetdis_USA]_b[unscall_pastunga] = [lnWBlend]_b[unscall_pastunga]
		di `r(p)' / 2 // This reports the p-value of a one-sided test 0.048


		
		
		
		
		
****APPENDIX:



*FIGURE A1 
use  "unscdata.dta", clear

gen lnUNSCgooglehits = ln(UNSCgooglehits+1)
lab var lnUNSCgooglehits "Number of Google hits (ln)"

gen UNSCgooglehits_plus1 = UNSCgooglehits + 1
lab var UNSCgooglehits_plus1 "number of Google hits"

bys year: egen UNSCgooglehits_ymedian = median(UNSCgooglehits) if country == "Afghanistan"
lab var UNSCgooglehits_ymedian "yearly median"

sort code vote_id
lab var resolution_num "Resolution number" 
twoway (scatter UNSCgooglehits_plus1 resolution_num if country == "Afghanistan" & UNSCgooglehits_plus1 >= UNSCgooglehits_ymedian, ///
yscale(log) xlabel(0 (500) 2000) xscale(range(0 2260)) msize(small) msymbol(X) mcolor(maroon) graphregion(color(white)) bgcolor(white) ylabel(0 1 2 5 10 20 50 100 200 500 1000 2000,nogrid angle(0))) ///
(scatter UNSCgooglehits_plus1 resolution_num if country == "Afghanistan" & UNSCgooglehits_plus1 < UNSCgooglehits_ymedian, ///
yscale(log) xlabel(0 (500) 2000) xscale(range(0 2260)) msize(small) msymbol(oh) mcolor(black) graphregion(color(white)) bgcolor(white) ylabel(0 1 2 5 10 20 50 100 200 500 1000 2000,nogrid angle(0))) ///
		, legend(cols(1) label(1 "above yearly median ('important resolution')") label(2 "below yearly median ('unimportant resolution')")) scheme(s2color)
	graph export "graphs/FigureA1.png", as(png) replace

 


*TABLE A2 

use "regressiondata.dta", clear

	*set sample
	xtreg  lnODAnetdis_USA  unsc l_lngdppcconst l_lnpop   yearFE* if  oda == 1 & p5 == 0 , fe cluster(countryid) //

	*view statistics on screen
	estpost summarize ///
	unsc voteagainstUSA_cytot /// 
	votedallwithUSA  votednotallwithUSA   votedallwithUSA_higoo_nor votednotallwithUSA_higoo_nor   ///  
	lngdppcconst lnpop pastIMF /// 
	past_aid_dummy past_unga  /// 
	lnODAnetdis_USA IMFcommitments_lny lnWBlend /// 
	oda /// 
	lnODAOOFnetdis_IsDB lnODAOOFnetdis_EBRD /// 
	nytimes  votednotallwithUSA_isr votedallwithUSA_isr votedallwithUSA_noext votednotallwithUSA_noext voteagainstUSA_cymean   /// 
	past_ideal  /// 
	war  odarec trade fdiin domcredit /// 
	 if e(sample) // to view on screen
	
	*label for export:
	label var unsc "UNSC"
	label var voteagainstUSA_cytot "UNSC, votes against US"
	label var votedallwithUSA "UNSC, voted all with US "
	label var votednotallwithUSA "UNSC, voted not all with US"
	label var voteagainstUSA_disag_cymean "UNSC, share of votes against US (contested)"
	label var voteagainstUSA_cymean "UNSC, share of votes against US"
	label var lnODAnetdis_USA "US aid disbursements (million USD, ln)"
	label var IMFcommitments_lny "IMF loans (million SDR, ln)"
	label var lnWBlend "WB loans (million USD, ln)"
	label var lngdppcconst "GDP per capita (ln)"
	label var l_lngdppcconst "GDP per capita (ln, t-1)"
	label var lnpop "Population (ln)"
	label var pastIMF "Past IMF program"
	label var past_aid_dummy "Past US aid recipient"
	label var nytimes "Number of NYTimes articles on UNSC"
	label var votedallwithUSA_imp "UNSC, voted all with US (important year NYT)"
	label var votedallwithUSA_unimp "UNSC, voted all with US (unimportant year NYT)"
	label var votednotallwithUSA_imp "UNSC, voted not all with US (important year NYT)"
	label var votednotallwithUSA_unimp "UNSC, voted not all with US (unimportant year NYT)"
	label var votedallwithUSA_higoo_nor "UNSC, voted all with US (important Google)"
	label var votednotallwithUSA_higoo_nor  "UNSC, voted not all with US (important Google)"
	label var votedallwithUSA_isr "UNSC, voted all with US (only Israel-related)"
	label var votednotallwithUSA_isr "UNSC, voted not all with US (only Israel-related)"
	label var votedallwithUSA_noext "UNSC, voted all with US (excl. extensions)"
	label var votednotallwithUSA_noext "UNSC, voted not all with US (excl. extensions)"


	label var past_ideal "Idealpoint distance to US (t-5 to t-2)"

	label var lnODAOOFnetdis_IsDB  "IsDB aid disbursements (million USD, ln)"
	label var lnODAOOFnetdis_EBRD  "EBRD aid disbursements (million USD, ln)"

	label var odarec "Total ODA received (% GDP)"
	label var trade "Trade (% GDP)"
	label var fdiin "Incoming FDI (% GDP)"
	label var domcredit "Domestic private sector credit (% GDP)"


	*export:
	capture noisily esttab using "tables/TableA2.txt", cells("Variables (`e(labels)')  count(fmt(0))  mean(fmt(2)) sd(fmt(2)) min(fmt(2)) max(fmt(2))") noobs tab label replace 

		
*FIGURE A2

	*set sample
	xtreg  lnODAnetdis_USA  unsc   							  	l_lngdppcconst l_lnpop  war  yearFE* if  oda == 1 & p5 == 0 , fe cluster(countryid) 
	cap drop baselinesample
	cap gen baselinesample = 1 if e(sample)
	
	*produce graph:
	graph bar (count) lnODAnetdis_USA if baselinesample == 1 , over(past_aid_dummy, relabel(1 "no" 2 "yes")) ///
	ytitle("") ylabel(,nogrid) graphregion(color(white)) bgcolor(white) ///
	blabel(total, size(medsmall) format(%9.0fc)) ///
	note("Received US Aid" "(in previous period)", pos(6) size(medsmall))
	graph export "graphs/FigureA2.png", replace

	
*FIGURE A3
	
gen favorable = Veryfavorable + Mostlyfavorable 
gen unfavorable = Mostlyunfavorable + Veryunfavorable 

gen lnpctagreeus_unga = ln(pctagreeus_unga)
corr favorable lnpctagreeus_unga

gen pctagreeus_unga100 = pctagreeus_unga*100
twoway (scatter  pctagreeus_unga100 favorable if pctagreeus_unga != 0, msymbol(X) ) , graphregion(color(white)) bgcolor(white) ylab(,nogrid angle(0)) ///
 yscale(log) ylabel(5 10 20 40 80) ///
 ytitle("Country's share of UNGA votes with US (%)") xtitle("US voters with favorable view of country (%)") text(4 80 "r = 0.70")
graph export "graphs/FigureA3.png", replace



	
*TABLE A4
 
 		xtreg lnODAnetdis_USA    c.unsc##c.past_aid_dummy     																		l_lngdppcconst lnpop  		 yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			est store aidrec1us
				estadd local "Dependent" US aid
				estadd local "Votes" -
				estadd local "Controls" yes
		xtreg lnODAnetdis_USA    c.votedallwithUSA##c.past_aid_dummy  c.votednotallwithUSA##c.past_aid_dummy   						l_lngdppcconst lnpop 		 yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			est store aidrec2us
				estadd local "Dependent" US aid
				estadd local "Votes" all
				estadd local "Controls" yes
		xtreg lnODAnetdis_USA    c.votedallwithUSA_higoo_nor##c.past_aid_dummy  c.votednotallwithUSA_higoo_nor##c.past_aid_dummy   	l_lngdppcconst lnpop 		 yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			est store aidrec3us
				estadd local "Dependent" US aid
				estadd local "Votes" important
				estadd local "Controls" yes
		
		xtreg IMFcommitments_lny    c.unsc##c.past_aid_dummy     																		l_lngdppcconst lnpop pastIMF	 yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			est store aidrec1imf
				estadd local "Dependent" IMF loans
				estadd local "Votes" -
				estadd local "Controls" yes
		xtreg IMFcommitments_lny    c.votedallwithUSA##c.past_aid_dummy  c.votednotallwithUSA##c.past_aid_dummy   						l_lngdppcconst lnpop pastIMF 	yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			est store aidrec2imf
				estadd local "Dependent" IMF loans
				estadd local "Votes" all
				estadd local "Controls" yes
		xtreg IMFcommitments_lny    c.votedallwithUSA_higoo_nor##c.past_aid_dummy  c.votednotallwithUSA_higoo_nor##c.past_aid_dummy   	l_lngdppcconst lnpop pastIMF	 yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			est store aidrec3imf
				estadd local "Dependent" IMF aid
				estadd local "Votes" important
				estadd local "Controls" yes
				
		xtreg lnWBlend    			c.unsc##c.past_aid_dummy     																		l_lngdppcconst lnpop  		 yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			est store aidrec1wb
				estadd local "Dependent" WB loans
				estadd local "Votes" -
				estadd local "Controls" yes
		xtreg lnWBlend   			 c.votedallwithUSA##c.past_aid_dummy  c.votednotallwithUSA##c.past_aid_dummy   						l_lngdppcconst lnpop  		yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			est store aidrec2wb
				estadd local "Dependent" WB loans
				estadd local "Votes" all
				estadd local "Controls" yes
		xtreg lnWBlend    			c.votedallwithUSA_higoo_nor##c.past_aid_dummy  c.votednotallwithUSA_higoo_nor##c.past_aid_dummy   	l_lngdppcconst lnpop 		 yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			est store aidrec3wb
				estadd local "Dependent" WB loans
				estadd local "Votes" important
				estadd local "Controls" yes
				
			
	estout aidrec* using "tables/TableA4.xls", title(" ") ///
					 replace delimiter(_tab) label noabbrev style(tab) collabels(none) ///
					 drop(_cons l_lngdppcconst lnpop pastIMF) indicate("Country FE and Year FE" = yearFE*)  ///
					 order(unsc c.unsc#c.past_aid_dummy votedallwithUSA c.votedallwithUSA#c.past_aid_dummy votednotallwithUSA c.votednotallwithUSA#c.past_aid_dummy votedallwithUSA_higoo_nor c.votedallwithUSA_higoo_nor#c.past_aid_dummy votednotallwithUSA_higoo_nor c.votednotallwithUSA_higoo_nor#c.past_aid_dummy) ///
					 cells(b(star fmt(3)) se(par([ ]) abs fmt(3))) starlevels(* 0.1 ** 0.05 *** 0.01) ///
					 stats(Controls N r2 Votes Dependent, fmt(0 0 3 0) label("Control Variables" "Observations" "R-squared" "Votes" "Dependent Variable"))  ///
					 mlabels("[1]" "[2]" "[3]" "[4]" "[5]" "[6]" "[7]" "[8]" "[9]" "[10]" "[11]" "[12]") ///
					 note("Notes: Standard errors clustered on the country-level are in brackets. Significance levels: * p < 0.1; ** p < 0.05; *** p < 0.01")


	
*Table A5:

use "regressiondata.dta", clear



	xtset countryid year
	sort countryid year

	cap est drop tab2*
	

	
	*COLUMN 1:
	 xtreg lnODAnetdis_USA     unsc unscXpastunga past_unga						l_lngdppcconst lnpop yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			est store tab2a1
			estadd local "Dependent" US aid	
			estadd local "Votes" -
			
	*COLUMN 2
	xtreg lnODAnetdis_USA   votedallwithUSA  votednotallwithUSA unscall_pastunga unscnotallXpastunga past_unga		l_lngdppcconst lnpop   yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
			est store tab2a2
			estadd local "Dependent" US aid	
			estadd local "Votes" all
	
	*COLUMN 3
	xtreg lnODAnetdis_USA   votedallwithUSA_higoo_nor  votednotallwithUSA_higoo_nor unscallimp_pastunga unscnotallimpXpastunga past_unga 	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)
		est store tab2a3
			estadd local "Dependent" US aid
			estadd local "Votes" important

			
	*COLUMN 4		 
	xtreg IMFcommitments_lny  past_unga unsc unscXpastunga  														l_lngdppcconst lnpop pastIMF yearFE*  if oda == 1  & p5 == 0 , fe cluster(countryid) 
			est store tab2b1
			estadd local "Dependent" IMF loans
			estadd local "Votes" -
			
	*COLUMN 5	
	xtreg IMFcommitments_lny  votedallwithUSA  votednotallwithUSA unscall_pastunga unscnotallXpastunga past_unga    l_lngdppcconst lnpop pastIMF  yearFE*  if oda == 1  & p5 == 0 , fe cluster(countryid) 
			est store tab2b2
			estadd local "Dependent" IMF loans 
			estadd local "Votes" all
		
	*COLUMN 6
	xtreg IMFcommitments_lny  votedallwithUSA_higoo_nor  votednotallwithUSA_higoo_nor unscallimp_pastunga unscnotallimpXpastunga past_unga 	l_lngdppcconst lnpop pastIMF yearFE*  if oda == 1  & p5 == 0 , fe cluster(countryid) 
		est store tab2b3
				estadd local "Dependent" IMF loans
				estadd local "Votes" important


	*COLUMN 7	
	xtreg lnWBlend  unsc unscXpastunga past_unga   l_lngdppcconst lnpop  yearFE*  if oda == 1  & p5 == 0 , fe cluster(countryid) 
			est store tab2c1
			estadd local "Dependent" WB loans
			estadd local "Votes" -
	
	*COLUMN 8
	xtreg lnWBlend  votedallwithUSA  votednotallwithUSA unscall_pastunga unscnotallXpastunga past_unga  		l_lngdppcconst lnpop  yearFE*  if oda == 1  & p5 == 0  , fe cluster(countryid) 
			est store tab2c2
			estadd local "Dependent" WB loans 
			estadd local "Votes" all
			
	*COLUMN 9
	xtreg lnWBlend votedallwithUSA_higoo_nor  votednotallwithUSA_higoo_nor unscallimp_pastunga unscnotallimpXpastunga past_unga 		l_lngdppcconst lnpop  yearFE*  if oda == 1  & p5 == 0 , fe cluster(countryid) 
		est store tab2c3
				estadd local "Dependent" WB loans
				estadd local "Votes" important



	estout tab2* using "tables/TableA5.xls", title(" ") ///
		 replace delimiter(_tab) label noabbrev style(tab) collabels(none) ///
		 drop(_cons ) indicate("Country FE and Year FE" = yearFE*)  ///
		 order(unsc unscXpastunga votedallwithUSA unscall_pastunga votednotallwithUSA unscnotallXpastunga votedallwithUSA_higoo_nor unscallimp_pastunga votednotallwithUSA_higoo_nor unscnotallimpXpastunga ) ///
		 cells(b(star fmt(3)) se(par([ ]) abs fmt(3))) starlevels(* 0.1 ** 0.05 *** 0.01) ///
		 stats(N r2 Votes Dependent, fmt(0 3 0) label( "Observations" "R-squared" "Votes" "Dependent Variable"))  ///
		 mlabels("[1]" "[2]" "[3]" "[4]" "[5]" "[6]" "[7]" "[8]" "[9]" "[10]" "[11]" "[12]") ///
		 note("Notes: Standard errors clustered on the country-level are in brackets. Significance levels: * p < 0.1; ** p < 0.05; *** p < 0.01")

		 
		 
		 
*TABLE A6

use "regressiondata.dta", clear

	*Robust: ISDB		
			
		xtreg  lnODAOOFnetdis_IsDB  votedallwithUSA  votednotallwithUSA    		l_lngdppcconst lnpop    yearFE*  if oda == 1 & p5 == 0  ,  fe cluster(countryid) //
			est store placebo1
			estadd local "Dependent" IsDB loans
		xtreg  lnODAOOFnetdis_IsDB  votedallwithUSA c.votedallwithUSA#c.past_unga votednotallwithUSA c.votednotallwithUSA#c.past_unga past_unga     		l_lngdppcconst lnpop    yearFE*  if oda == 1 & p5 == 0  ,  fe cluster(countryid) //
			est store placebo2
			estadd local "Dependent" IsDB loans
			margins, dydx(votedallwithUSA) at(past_unga = (0 (0.05) 1))	
			marginsplot, level(95) title(" ", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US") legend(off) graphregion(color(white)) bgcolor(white)  ///
						ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
						addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) )) 
			
			graph export "graphs/FigureA4.png", replace // 
	
	*Robust: EBRD

		
		xtreg  lnODAOOFnetdis_EBRD  votedallwithUSA votednotallwithUSA   l_lngdppcconst lnpop    yearFE*  if oda == 1 & p5 == 0  ,  fe cluster(countryid) //  
			est store placebo3
			estadd local "Dependent" EBRD loans
		xtreg  lnODAOOFnetdis_EBRD  votedallwithUSA c.votedallwithUSA#c.past_unga votednotallwithUSA c.votednotallwithUSA#c.past_unga past_unga     		l_lngdppcconst lnpop    yearFE*  if oda == 1 & p5 == 0  ,  fe cluster(countryid) //  
			est store placebo4
			estadd local "Dependent" EBRD loans
			margins, dydx(votedallwithUSA) at(past_unga = (0 (0.05) 1))	 // 
				marginsplot, level(95) title(" ", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US") legend(off) graphregion(color(white)) bgcolor(white)  ///
						ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
						addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) )) 
				graph export "graphs/FigureA5.png", replace // 
	
	
estout placebo* using "tables/TableA6.xls", title("") ///
 replace delimiter(_tab) label noabbrev style(tab) collabels(none) ///
 drop( l_lngdppcconst lnpop  _cons ) indicate("Country FE, Year FE, Controls" = yearFE*)   ///
 order( votedallwithUSA votednotallwithUSA) ///
 interaction(" x ") ///
 cells(b(star fmt(3)) se(par([ ]) abs fmt(3))) starlevels(* 0.1 ** 0.05 *** 0.01) ///
 stats(N r2 Dependent, fmt(0 3 3 0 0) label("Observations" "R-squared" "Dependent Variable"))  ///
 mlabels("[1]" "[2]" "[3]" "[4]") //

	
	
* TABLE A7

xtreg  lnODAnetdis_USA votedallwithUSA_unimp votedallwithUSA_imp votednotallwithUSA_unimp votednotallwithUSA_imp			l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	est store vUSnyt			
		estadd local "Dependent" US aid
		estadd local "Votes" all	


xtreg  lnODAnetdis_USA votedallwithUSA_higoo_nor  votednotallwithUSA_higoo_nor 		l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0 , fe cluster(countryid) // 
	est store vUSimp
		estadd local "Dependent" US aid
		estadd local "Votes" Google important
		
		
xtreg  lnODAnetdis_USA votedallwithUSA_isr votednotallwithUSA_isr													l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	est store vUSisr
		estadd local "Dependent" US aid
		estadd local "Votes" related to Israel
			
xtreg  lnODAnetdis_USA unsc c.unsc#c.voteagainstUSA_cymean  															l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	est store vUSvot
		estadd local "Dependent" US aid
		estadd local "Votes" all	

xtreg  IMFcommitments_lny votedallwithUSA_unimp votedallwithUSA_imp votednotallwithUSA_unimp votednotallwithUSA_imp			l_lngdppcconst lnpop pastIMF  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	est store vIMFnyt			
		estadd local "Dependent" IMF loans
		estadd local "Votes" all	

xtreg  IMFcommitments_lny votedallwithUSA_higoo_nor  votednotallwithUSA_higoo_nor 		l_lngdppcconst lnpop  pastIMF yearFE*  if oda == 1 & p5 == 0 , fe cluster(countryid) // 
	est store vIMFimp
	estadd local "Dependent" IMF loans
	estadd local "Votes" Google important

xtreg  IMFcommitments_lny votedallwithUSA_isr votednotallwithUSA_isr	  															l_lngdppcconst lnpop pastIMF yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	est store vIMFisr
		estadd local "Dependent" IMF loans
		estadd local "Votes" related to Israel	
	
xtreg  IMFcommitments_lny unsc c.unsc#c.voteagainstUSA_cymean  															l_lngdppcconst lnpop pastIMF yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	est store vIMFvot
		estadd local "Dependent" IMF loans
		estadd local "Votes" all	
	
xtreg  lnWBlend votedallwithUSA_unimp votedallwithUSA_imp votednotallwithUSA_unimp votednotallwithUSA_imp			l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	est store vWBnyt			
		estadd local "Dependent" WB loans
		estadd local "Votes" all	

xtreg  lnWBlend votedallwithUSA_higoo_nor  votednotallwithUSA_higoo_nor 				l_lngdppcconst lnpop   yearFE*  if oda == 1 & p5 == 0  , fe cluster(countryid) // 
	est store vWBimp
	estadd local "Dependent" WB loans
	estadd local "Votes" important
	
xtreg  lnWBlend  votedallwithUSA_isr votednotallwithUSA_isr														l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	est store vWBisr
		estadd local "Dependent" WB loans
		estadd local "Votes" related to Israel

xtreg  lnWBlend unsc c.unsc#c.voteagainstUSA_cymean  															l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	est store vWBvot
		estadd local "Dependent" WB loans
		estadd local "Votes" all	
	
estout vUS* vIMF* vWB* using "tables/TableA7.xls", title("") ///
 replace delimiter(_tab) label noabbrev style(tab) collabels(none) ///
 drop( l_lngdppcconst lnpop pastIMF _cons ) indicate("Country FE, Year FE, Controls" = yearFE*)   ///
 order( votedallwithUSA_imp  votedallwithUSA_unimp votednotallwithUSA_imp  votednotallwithUSA_unimp votedallwithUSA_higoo_nor  votednotallwithUSA_higoo_nor  votedallwithUSA_isr votednotallwithUSA_isr	 unsc c.unsc#c.voteagainstUSA_cymean) ///
 cells(b(star fmt(3)) se(par([ ]) abs fmt(3))) starlevels(* 0.1 ** 0.05 *** 0.01) ///
 stats(N r2 Votes Dependent, fmt(0 3 3 0 0) label("Observations" "R-squared" "UNSC Votes" "Dependent Variable"))  ///
 mlabels("[1]" "[2]" "[3]" "[4]" "[5]" "[6]" "[7]" "[8]" "[9]" "[10]" "[11]" "[12]") //

 
		 
		 
		 
*Table A8

		
		xtset countryid year
		sort countryid year
		
		
*set sample	
xtreg  lnODAnetdis_USA  unsc   							  	l_lngdppcconst lnpop   yearFE* if  oda == 1 & p5 == 0 , fe cluster(countryid) 
	cap drop baselinesample
	cap gen baselinesample = 1 if e(sample)
	
	keep if baselinesample == 1

	
*US ODA		

	
cap est drop t*
***NYT
*graph
xtreg lnODAnetdis_USA   c.votedallwithUSA_imp##c.past_unga c.votednotallwithUSA_imp##c.past_unga ///
		past_unga 	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)
margins, dydx(votedallwithUSA_imp) at(past_unga = (0 (0.05) 1))
	marginsplot, level(95) title("Dependent variable: US aid", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US" "only important years (NYTimes)") legend(off) graphregion(color(white)) bgcolor(white)  ///
		ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
	graph export "graphs/FigureA6_1.png", replace	

*table	
xtreg lnODAnetdis_USA   votedallwithUSA_imp votednotallwithUSA_imp votedallwithUSA_impXunga votednotallwithUSA_impXunga ///
		past_unga 	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)	
	est store tUSnyt
		estadd local "Dependent" US aid
		estadd local "Votes" NYTimes
		
***Google
*graph	
xtreg lnODAnetdis_USA    c.votedallwithUSA_higoo_nor##c.past_unga c.votednotallwithUSA_higoo_nor##c.past_unga  		l_lngdppcconst lnpop   yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
		est store tab2a3
		estadd local "Dependent" US aid
		estadd local "Votes" important				
	margins, dydx(votedallwithUSA_higoo_nor) at(past_unga = (0 (0.05) 1))
	marginsplot, level(95) title("Dependent variable: US aid", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US" "only important resolutions (Google)") legend(off) graphregion(color(white)) bgcolor(white)  ///
		ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
	graph export "graphs/FigureA6_2.png", replace	
	
*table
xtreg lnODAnetdis_USA   votedallwithUSA_higoo_nor  votednotallwithUSA_higoo_nor unscallimp_pastunga unscnotallimpXpastunga past_unga 	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)
	est store tUSgoogle
		estadd local "Dependent" US aid
		estadd local "Votes" Google
		

***Israel

*graph
xtreg lnODAnetdis_USA    c.votedallwithUSA_isr##c.past_unga c.votednotallwithUSA_isr##c.past_unga  		l_lngdppcconst lnpop   yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	margins, dydx(votedallwithUSA_isr) at(past_unga = (0 (0.05) 1))
	marginsplot, level(95) title("Dependent variable: US aid", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US" "only Israel-related resolution") legend(off) graphregion(color(white)) bgcolor(white)  ///
		ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
	graph export "graphs/FigureA6_3.png", replace	

	*table
	 xtreg lnODAnetdis_USA   votedallwithUSA_isr  votednotallwithUSA_isr unscallisr_pastunga unscnotallisrXpastunga past_unga 	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)
	est store tUSisrael
		estadd local "Dependent" US aid
		estadd local "Votes" Israel

		
		
		
*****IMF

***NYT
*graph
xtreg IMFcommitments_lny   c.votedallwithUSA_imp##c.past_unga c.votednotallwithUSA_imp##c.past_unga  ///
		past_unga 	l_lngdppcconst lnpop pastIMF yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)
margins, dydx(votedallwithUSA_imp) at(past_unga = (0 (0.05) 1))
	marginsplot, level(95) title("Dependent variable: IMF loans", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US" "only important years (NYTimes)") legend(off) graphregion(color(white)) bgcolor(white)  ///
		ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
	graph export "graphs/FigureA6_4.png", replace	

*table	
xtreg IMFcommitments_lny   votedallwithUSA_imp votednotallwithUSA_imp votedallwithUSA_impXunga votednotallwithUSA_impXunga ///
		past_unga 	l_lngdppcconst lnpop pastIMF yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)	
	est store tIMFnyt
		estadd local "Dependent" IMF loans
		estadd local "Votes" NYTimes
		
***Google
*graph	
xtreg IMFcommitments_lny    c.votedallwithUSA_higoo_nor##c.past_unga c.votednotallwithUSA_higoo_nor##c.past_unga  		l_lngdppcconst lnpop  pastIMF yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
		est store tab2a3
		estadd local "Dependent" IMF loans
		estadd local "Votes" important				
	margins, dydx(votedallwithUSA_higoo_nor) at(past_unga = (0 (0.05) 1))
	marginsplot, level(95) title("Dependent variable: IMF loans", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US" "only important resolutions (Google)") legend(off) graphregion(color(white)) bgcolor(white)  ///
		ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
	graph export "graphs/FigureA6_5.png", replace	
	
*table
xtreg IMFcommitments_lny   votedallwithUSA_higoo_nor  votednotallwithUSA_higoo_nor unscallimp_pastunga unscnotallimpXpastunga past_unga 	l_lngdppcconst lnpop pastIMF  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)
	est store tab2a3

est store tIMFgoogle
		estadd local "Dependent" IMF loans
		estadd local "Votes" Google
		

***Israel

*graph
xtreg IMFcommitments_lny    c.votedallwithUSA_isr##c.past_unga c.votednotallwithUSA_isr##c.past_unga  		l_lngdppcconst lnpop pastIMF  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	margins, dydx(votedallwithUSA_isr) at(past_unga = (0 (0.05) 1))
	marginsplot, level(95) title("Dependent variable: IMF loans", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US" "only Israel-related resolution") legend(off) graphregion(color(white)) bgcolor(white)  ///
		ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
	graph export "graphs/FigureA6_6.png", replace	

	*table
xtreg IMFcommitments_lny   votedallwithUSA_isr  votednotallwithUSA_isr unscallisr_pastunga unscnotallisrXpastunga past_unga 	l_lngdppcconst lnpop pastIMF yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)
	est store tIMFisrael
		estadd local "Dependent" IMF loans
		estadd local "Votes" Israel


*****WB 
		

***NYT
*graph
xtreg lnWBlend   c.votedallwithUSA_imp##c.past_unga c.votednotallwithUSA_imp##c.past_unga  ///
		past_unga 	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)
margins, dydx(votedallwithUSA_imp) at(past_unga = (0 (0.05) 1))
	marginsplot, level(95) title("Dependent variable: WB loans", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US" "only important years (NYTimes)") legend(off) graphregion(color(white)) bgcolor(white)  ///
		ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
	graph export "graphs/FigureA6_7.png", replace	

*table	
xtreg lnWBlend   votedallwithUSA_imp votednotallwithUSA_imp votedallwithUSA_impXunga votednotallwithUSA_impXunga ///
		past_unga 	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)	
	est store tWBnyt
		estadd local "Dependent" WB loans
		estadd local "Votes" NYTimes
		
***Google
*graph	
xtreg lnWBlend    c.votedallwithUSA_higoo_nor##c.past_unga c.votednotallwithUSA_higoo_nor##c.past_unga  		l_lngdppcconst lnpop   yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
		est store tab2a3
		estadd local "Dependent" UWB loans
		estadd local "Votes" important				
	margins, dydx(votedallwithUSA_higoo_nor) at(past_unga = (0 (0.05) 1))
	marginsplot, level(95) title("Dependent variable: WB loans", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US" "only important resolutions (Google)") legend(off) graphregion(color(white)) bgcolor(white)  ///
		ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
	graph export "graphs/FigureA6_8.png", replace	
	
*table
xtreg lnWBlend   votedallwithUSA_higoo_nor  votednotallwithUSA_higoo_nor unscallimp_pastunga unscnotallimpXpastunga past_unga 	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)
	est store tab2a3

est store tWBgoogle
		estadd local "Dependent" WB loans
		estadd local "Votes" Google
		

***Israel

*graph
xtreg lnWBlend    c.votedallwithUSA_isr##c.past_unga c.votednotallwithUSA_isr##c.past_unga  		l_lngdppcconst lnpop   yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	margins, dydx(votedallwithUSA_isr) at(past_unga = (0 (0.05) 1))
	marginsplot, level(95) title("Dependent variable: WB loans", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US" "only Israel-related resolution") legend(off) graphregion(color(white)) bgcolor(white)  ///
		ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
	graph export "graphs/FigureA6_9.png", replace	

*table
	 xtreg lnWBlend   votedallwithUSA_isr  votednotallwithUSA_isr unscallisr_pastunga unscnotallisrXpastunga past_unga 	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid)
	est store tWBisrael
		estadd local "Dependent" WB loans
		estadd local "Votes" Israel



estout tUS* tIMF* tWB* using "tables/TableA8.xls", title(" ") ///
	 replace delimiter(_tab) label noabbrev style(tab) collabels(none) ///
	 drop(_cons ) indicate("Country FE and Year FE" = yearFE*)  ///
	 order( ///
	 votedallwithUSA_imp votednotallwithUSA_imp votedallwithUSA_impXunga votednotallwithUSA_impXunga ///
	 votedallwithUSA_higoo_nor  votednotallwithUSA_higoo_nor unscallimp_pastunga unscnotallimpXpastunga ///
	 votedallwithUSA_isr  votednotallwithUSA_isr unscallisr_pastunga unscnotallisrXpastunga ) ///
	 cells(b(star fmt(3)) se(par([ ]) abs fmt(3))) starlevels(* 0.1 ** 0.05 *** 0.01) ///
	 stats(N r2 Votes Dependent, fmt(0 3 0) label( "Observations" "R-squared" "Votes" "Dependent Variable"))  ///
	 mlabels("[1]" "[2]" "[3]" "[4]" "[5]" "[6]" "[7]" "[8]" "[9]" "[10]" "[11]" "[12]") ///
	 note("Notes: Standard errors clustered on the country-level are in brackets. Significance levels: * p < 0.1; ** p < 0.05; *** p < 0.01")

	
	
*FIGURE A7
	
	use "rawunscdata.dta", replace
	
	* count the number of votes against US per resolution
	gen numberagainstUS = 		NO + ABSTAIN 	if UnitedStates == 1
	replace numberagainstUS = 	YES + NO  		if UnitedStates == 2
	replace numberagainstUS = 	YES + NO  		if UnitedStates == 8
	replace numberagainstUS = 	YES + ABSTAIN 	if UnitedStates == 3
 
	hist numberagainstUS if res_memberadmit == 1, frequency bin(15) title("Admission of new members") xtitle("Number of votes against US") ytitle("Frequency") scheme(plotplain)
	graph save "graphs/memberadmit", replace
	hist numberagainstUS if res_israel == 1, frequency bin(15) title("Israel") xtitle("Number of votes against US") ytitle("Frequency") scheme(plotplain)
	graph save "graphs/israel", replace
	hist numberagainstUS if res_lebanon == 1, frequency bin(15) title("Lebanon") xtitle("Number of votes against US") ytitle("Frequency") scheme(plotplain)
	graph save "graphs/lebanon", replace
	hist numberagainstUS if res_cyprus == 1, frequency bin(15) title("Cyprus") xtitle("Number of votes against US") ytitle("Frequency") scheme(plotplain)
	graph save "graphs/cyprus", replace
	hist numberagainstUS if res_sanction == 1, frequency bin(15) title("Sanctions") xtitle("Number of votes against US") ytitle("Frequency") scheme(plotplain)
	graph save "graphs/sanction", replace
	hist numberagainstUS if res_extent == 1, frequency bin(15) title("Extensions of existing resolutions") xtitle("Number of votes against US") ytitle("Frequency") scheme(plotplain)
	graph save "graphs/extent", replace
	
	graph combine graphs/memberadmit.gph graphs/israel.gph graphs/lebanon.gph graphs/cyprus.gph graphs/sanction.gph graphs/extent.gph , col(2)
	graph export "graphs/FigureA7.png", replace
	
	erase "graphs/memberadmit.gph"
	erase "graphs/israel.gph"
	erase "graphs/lebanon.gph"
	erase "graphs/cyprus.gph"
	erase "graphs/sanction.gph"
	erase "graphs/extent.gph"

	

*Table A9
use "regressiondata.dta", clear

local exclusions "noisr noad noleb nocyp nosan noext"
foreach ex of local exclusions {
	gen votedallwithUS_`ex' = 0
	replace votedallwithUS_`ex' = 1 if unsc == 1 & voteagainstUSA_`ex'_cymean == 0
	gen votednotallwithUS_`ex' = 0
	replace votednotallwithUS_`ex' = 1 if unsc == 1 & voteagainstUSA_`ex'_cymean > 0 & voteagainstUSA_`ex'_cymean != .
}	

cap est drop US* IMF* WB*
local exclusions "noad noisr noleb nocyp nosan noext"
foreach ex of local exclusions {
		gen all = votedallwithUS_`ex'
		gen notall = votednotallwithUS_`ex'
		lab var all "UNSC, voted all with USA"
		lab var notall "UNSC, voted not all with USA"
	 xtreg  lnODAnetdis_USA  	all notall	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
		est store US`ex'
		estadd local Dependent "US aid"
			if "`ex'" == "noisr" {
			estadd local Votes "Israel" 
			}
			if "`ex'" == "noad" {
			estadd local Votes "Admissions" 
			}
			if "`ex'" == "noleb" {
			estadd local Votes "Lebanon" 
			}
			if "`ex'" == "nocyp" {
			estadd local Votes "Cyprus" 
			}
			if "`ex'" == "nosan" {
			estadd local Votes "Sanctions" 
			}
			if "`ex'" == "noext" {
			estadd local Votes "Extensions" 
			}
	 xtreg  IMFcommitments_lny all notall	l_lngdppcconst lnpop pastIMF yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
		est store IMF`ex'
		estadd local Dependent "IMF loans"
			if "`ex'" == "noisr" {
			estadd local Votes "Israel" 
			}
			if "`ex'" == "noad" {
			estadd local Votes "Admissions" 
			}
			if "`ex'" == "noleb" {
			estadd local Votes "Lebanon" 
			}
			if "`ex'" == "nocyp" {
			estadd local Votes "Cyprus" 
			}
			if "`ex'" == "nosan" {
			estadd local Votes "Sanctions" 
			}
			if "`ex'" == "noext" {
			estadd local Votes "Extensions" 
			}
	 xtreg  lnWBlend 			all notall	l_lngdppcconst lnpop  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
		est store WB`ex'
		drop all notall
		estadd local Dependent "WB loans"
			if "`ex'" == "noisr" {
			estadd local Votes "Israel" 
			}
			if "`ex'" == "noad" {
			estadd local Votes "Admissions" 
			}
			if "`ex'" == "noleb" {
			estadd local Votes "Lebanon" 
			}
			if "`ex'" == "nocyp" {
			estadd local Votes "Cyprus" 
			}
			if "`ex'" == "nosan" {
			estadd local Votes "Sanctions" 
			}
			if "`ex'" == "noext" {
			estadd local Votes "Extensions" 
			}
}
estout US* IMF* WB* using "tables/TableA9.xls", title("") ///
 replace delimiter(_tab) label noabbrev style(tab) collabels(none) ///
 drop( l_lngdppcconst lnpop pastIMF _cons ) indicate("Country FE, Year FE, Controls" = yearFE*)   ///
 cells(b(star fmt(3)) se(par([ ]) abs fmt(3))) starlevels(* 0.1 ** 0.05 *** 0.01) ///
 stats(N r2 Votes Dependent, fmt(0 3 3 0 0) label("Observations" "R-squared" "Exluding Resolutions on:" "Dependent Variable"))  ///
 mlabels("[A1]" "[A2]" "[A3]" "[A4]" "[A5]" "[A6]" "[B1]" "[B2]" "[B3]" "[B4]" "[B5]" "[B6]" "[C1]" "[C2]" "[C3]" "[C4]" "[C5]" "[C6]") //


 
 
 *Table A10 and Table A11
	
		xtset countryid year
		sort countryid year

		
	
	cap est drop control*
			xtreg lnODAnetdis_USA   votedallwithUSA  votednotallwithUSA 		l_lngdppcconst lnpop war odarec trade fdiin domcredit  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
				est store control1
				estadd local Dependent "US aid"
			xtreg lnODAnetdis_USA    votedallwithUSA unscall_pastunga votednotallwithUSA unscnotallXpastunga past_unga  		l_lngdppcconst lnpop war odarec trade fdiin domcredit    yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
				est store control2
				estadd local Dependent "US aid" 
					xtreg lnODAnetdis_USA    c.votedallwithUSA##c.past_unga c.votednotallwithUSA##c.past_unga  		l_lngdppcconst lnpop war odarec trade fdiin domcredit    yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
					margins, dydx(votedallwithUSA) at(past_unga = (0 (0.05) 1))
					marginsplot, level(95) title(" ", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US") legend(off) graphregion(color(white)) bgcolor(white)  ///
						ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
						addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
								graph export "graphs/FigureA8_1.png", replace	
								
			
			xtreg IMFcommitments_lny   votedallwithUSA  votednotallwithUSA 		l_lngdppcconst lnpop pastIMF war odarec trade fdiin domcredit  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
				est store control3
				estadd local Dependent "IMF loans"
			xtreg IMFcommitments_lny    votedallwithUSA unscall_pastunga votednotallwithUSA unscnotallXpastunga past_unga 		l_lngdppcconst lnpop war pastIMF odarec trade fdiin domcredit    yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
					est store control4
					estadd local Dependent "IMF loans" 
					xtreg IMFcommitments_lny    c.votedallwithUSA##c.past_unga c.votednotallwithUSA##c.past_unga  		l_lngdppcconst lnpop pastIMF war odarec trade fdiin domcredit    yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
					margins, dydx(votedallwithUSA) at(past_unga = (0 (0.05) 1))
					marginsplot, level(95) title(" ", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US") legend(off) graphregion(color(white)) bgcolor(white)  ///
						ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
						addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
								graph export "graphs/FigureA8_2.png", replace	
								
				
			xtreg lnWBlend   votedallwithUSA  votednotallwithUSA 		l_lngdppcconst lnpop war odarec trade fdiin domcredit  yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
				est store control5
				estadd local Dependent "WB loans"
			xtreg lnWBlend    votedallwithUSA unscall_pastunga votednotallwithUSA unscnotallXpastunga past_unga  		l_lngdppcconst lnpop   war odarec trade fdiin domcredit    yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
				est store control6
				estadd local Dependent "WB loans" 
					xtreg lnWBlend    c.votedallwithUSA##c.past_unga c.votednotallwithUSA##c.past_unga  		l_lngdppcconst lnpop   war odarec trade fdiin domcredit    yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
					margins, dydx(votedallwithUSA) at(past_unga = (0 (0.05) 1))
					marginsplot, level(95) title(" ", color(black) size(medium)) xtitle("Allied" "(political proximity to US in previous period)") ytitle("Effect of UNSC, all with US") legend(off) graphregion(color(white)) bgcolor(white)  ///
						ylabel(-3 (1) 3 , nogrid angle(0) axis(1))  yscale(range(-3 3) axis(1)) xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
						addplot(hist past_unga if e(sample) , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (2) 6, axis(2) angle(0)) yscale(alt range(0 8) axis(2) ))  
								graph export "graphs/FigureA8_3.png", replace	
		
		
			lab var war "War"
			lab var odarec "Total ODA received (% GDP)"
			lab var trade "Trade (% GDP)"
			lab var fdiin "FDI (% GDP)"
			lab var domcredit "Domestic private credit (% GDP)"
			lab var lnpop "Population (ln)"
			
			estout control1 control3 control5 using "tables/TableA10.xls", title(" ") ///
					 replace delimiter(_tab) label noabbrev style(tab) collabels(none) ///
					 drop(_cons ) ///
					 order(votedallwithUSA  votednotallwithUSA  ) ///
					 indicate("Country FE, Year FE, Controls" = yearFE*)  ///
					 cells(b(star fmt(3)) se(par([ ]) abs fmt(3))) starlevels(* 0.1 ** 0.05 *** 0.01) ///
					 stats(N r2 Dependent, fmt(0 3 0 ) label( "Observations" "R-squared" "Dependent Variable"))  ///
					 mlabels("[1]" "[2]" "[3]" "[4]" "[5]" "[6]" "[7]" "[8]" "[9]" "[10]" "[11]" "[12]" "[13]" "[14]" "[15]" "[16]" "[17]" "[18]" "[19]" "[20]" "[21]") ///
					 note("Notes: Standard errors clustered on the country-level are in brackets. Significance levels: * p < 0.1; ** p < 0.05; *** p < 0.01")
 
 
			estout control* using "tables/TableA11.xls", title(" ") ///
					 replace delimiter(_tab) label noabbrev style(tab) collabels(none) ///
					 drop(_cons ) ///
					 order(votedallwithUSA unscall_pastunga votednotallwithUSA unscnotallXpastunga past_unga  ) ///
					 indicate("Country FE, Year FE, Controls" = yearFE*)  ///
					 cells(b(star fmt(3)) se(par([ ]) abs fmt(3))) starlevels(* 0.1 ** 0.05 *** 0.01) ///
					 stats(N r2 Dependent, fmt(0 3 0 ) label( "Observations" "R-squared" "Dependent Variable"))  ///
					 mlabels("[1]" "[2]" "[3]" "[4]" "[5]" "[6]" "[7]" "[8]" "[9]" "[10]" "[11]" "[12]" "[13]" "[14]" "[15]" "[16]" "[17]" "[18]" "[19]" "[20]" "[21]") ///
					 note("Notes: Standard errors clustered on the country-level are in brackets. Significance levels: * p < 0.1; ** p < 0.05; *** p < 0.01")
 


*FIGURE A9

	clear 
	clear matrix
	clear mata
	set maxvar 20000
	use "regressiondata.dta", clear

	
	keep  lnODAnetdis_USA IMFcommitments_lny lnWBlend votedallwithUSA votednotallwithUSA past_unga  l_lngdppcconst lnpop pastIMF oda p5 countryid year // 

	gen notallwithUSAXpast_unga = votednotallwithUSA * past_unga
	

	interflex lnODAnetdis_USA votedallwithUSA past_unga notallwithUSAXpast_unga votednotallwithUSA l_lngdppcconst lnpop     if oda == 1  & p5 == 0 , fe(countryid year) vce(cluster) cluster(countryid) type(kernel) bw(0.2)
		gr_edit .style.editstyle boxstyle(shadestyle(color(white))) editcopy
		gr_edit .plotregion1.plot3.style.editstyle area(linestyle(width(none))) editcopy
		gr_edit .plotregion1.plot4.style.editstyle area(shadestyle(color(red))) editcopy
		gr_edit .plotregion1.plot4.style.editstyle area(linestyle(color(red))) editcopy
		gr_edit .yaxis1.title.text = {}
		gr_edit .yaxis1.title.text.Arrpush Marginal Effect of UNSC on US aid
		gr_edit .xaxis1.title.text = {}
		gr_edit .xaxis1.title.text.Arrpush Moderator: Allied
		
		graph export "graphs/FigureA9_A.png", replace
		

	interflex IMFcommitments_lny votedallwithUSA past_unga notallwithUSAXpast_unga votednotallwithUSA l_lngdppcconst lnpop pastIMF   if oda == 1  & p5 == 0 , fe(countryid year) vce(cluster) cluster(countryid) type(kernel) bw(0.2)
		gr_edit .style.editstyle boxstyle(shadestyle(color(white))) editcopy
		gr_edit .plotregion1.plot3.style.editstyle area(linestyle(width(none))) editcopy
		gr_edit .plotregion1.plot4.style.editstyle area(shadestyle(color(red))) editcopy
		gr_edit .plotregion1.plot4.style.editstyle area(linestyle(color(red))) editcopy
		gr_edit .yaxis1.title.text = {}
		gr_edit .yaxis1.title.text.Arrpush Marginal Effect of UNSC on IMF loans
		gr_edit .xaxis1.title.text = {}
		gr_edit .xaxis1.title.text.Arrpush Moderator: Allied
		
		graph export "graphs/FigureA9_B.png", replace

	interflex lnWBlend votedallwithUSA past_unga notallwithUSAXpast_unga votednotallwithUSA l_lngdppcconst lnpop    if oda == 1  & p5 == 0 , fe(countryid year) vce(cluster) cluster(countryid) type(kernel) bw(0.2)
		gr_edit .style.editstyle boxstyle(shadestyle(color(white))) editcopy
		gr_edit .plotregion1.plot3.style.editstyle area(linestyle(width(none))) editcopy
		gr_edit .plotregion1.plot4.style.editstyle area(shadestyle(color(red))) editcopy
		gr_edit .plotregion1.plot4.style.editstyle area(linestyle(color(red))) editcopy
		gr_edit .yaxis1.title.text = {}
		gr_edit .yaxis1.title.text.Arrpush Marginal Effect of UNSC on WB loans
		gr_edit .xaxis1.title.text = {}
		gr_edit .xaxis1.title.text.Arrpush Moderator: Allied
		
		graph export "graphs/FigureA9_C.png", replace

		
	
	
	
*FIGURE A10

use "regressiondata.dta", clear

	xtreg lnODAnetdis_USA   votedallwithUSA c.votedallwithUSA#c.past_ideal votednotallwithUSA c.votednotallwithUSA#c.past_ideal  past_ideal 		l_lngdppcconst lnpop   yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
		est store ideal1
		estadd local "Dependent" US aid	
	xtreg lnODAnetdis_USA    c.votedallwithUSA##c.past_ideal c.votednotallwithUSA##c.past_ideal  		l_lngdppcconst lnpop   yearFE*  if oda == 1 & p5 == 0, fe cluster(countryid) 
	margins, dydx(votedallwithUSA) at(past_ideal = (0.5 (0.25) 4.5))
	marginsplot, level(95) title(" ", color(black) size(medium)) xtitle("Idealpoint distance to US") ytitle("Effect of UNSC, all with US") legend(off) graphregion(color(white)) ///
			ylabel(,nogrid)  xscale(range(0 5)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_ideal if e(sample) & past_ideal > 0, below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (1) 2., axis(2)) yscale(alt range(0 2) axis(2) ))  
			graph export "graphs/FigureA10_A.png", replace 			

			
			

	xtreg IMFcommitments_lny  votedallwithUSA c.votedallwithUSA#c.past_ideal votednotallwithUSA c.votednotallwithUSA#c.past_ideal past_ideal  		l_lngdppcconst lnpop   pastIMF yearFE*  if oda == 1  & p5 == 0 , fe cluster(countryid) 
		est store ideal2
		estadd local "Dependent" IMF loans 
	xtreg IMFcommitments_lny  c.votedallwithUSA##c.past_ideal c.votednotallwithUSA##c.past_ideal  		l_lngdppcconst lnpop war pastIMF  yearFE*  if oda == 1  & p5 == 0 , fe cluster(countryid) 
	margins, dydx(votedallwithUSA) at(past_ideal = (0 (0.25) 4.5))
	marginsplot, level(95) title(" ", color(black) size(medium)) xtitle("Idealpoint distance to US") ytitle("Effect of UNSC, all with US") legend(off) graphregion(color(white)) ///
		ylabel(,nogrid)  xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_ideal if e(sample) & past_ideal > 0, below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (1) 2, axis(2)) yscale(alt range(0 2) axis(2) ))  
				graph export "graphs/FigureA10_B.png", replace 			


	

	xtreg lnWBlend  votedallwithUSA c.votedallwithUSA#c.past_ideal votednotallwithUSA c.votednotallwithUSA#c.past_ideal past_ideal  		l_lngdppcconst lnpop    yearFE*  if oda == 1  & p5 == 0 , fe cluster(countryid) 
		est store ideal3
		estadd local "Dependent" WB loans
	xtreg lnWBlend  c.votedallwithUSA##c.past_ideal c.votednotallwithUSA##c.past_ideal  		l_lngdppcconst lnpop war   yearFE*  if oda == 1  & p5 == 0 , fe cluster(countryid) 
	margins, dydx(votedallwithUSA) at(past_ideal = (0 (0.25) 4.5))
	marginsplot, level(95) title(" ", color(black) size(medium)) xtitle("Idealpoint distance to US") ytitle("Effect of UNSC, all with US") legend(off) graphregion(color(white)) ///
		ylabel(,nogrid)  xscale(range(0 1)) xlabel(0 (0.2) 1) plotopts(msize(small) mcolor(black) lcolor(black)) ciopts(lwidth(thin) lcolor(black)) yline(0, lcolor(maroon)) ///
		addplot(hist past_ideal if e(sample) & past_ideal > 0 , below color("252 205 85") fcolor(none)  yaxis(2) ylabel(0 (1) 2, axis(2)) yscale(alt range(0 2) axis(2) ))  
				graph export "graphs/FigureA10_C.png", replace 			





*Table A12

use "regressiondata.dta", clear


gen pctagreeus_unga100 = pctagreeus_unga*100

lab var favorableviewofUS "Favorable views of US (%)"
lab var lngdppcconst "GDP per capita (ln)"
lab var lnpop "Population (ln)"
tab region, gen(regionfe)


reg   pctagreeus_unga100 favorableviewofUS  regionfe*  if  wdicode != "USA" , rob
est store views1

reg   pctagreeus_unga100 favorableviewofUS lngdppcconst regionfe* if  wdicode != "USA"  , rob
est store views2

reg   pctagreeus_unga100 favorableviewofUS lnpop lngdppcconst regionfe* if  wdicode != "USA" , rob
est store views3



estout views* using "tables/Table_A12.xls", title("") ///
 replace delimiter(_tab) label noabbrev style(tab) collabels(none) ///
 drop(_cons) indicate("Region FE" = regionfe*)  ///
 cells(b(star fmt(3)) se(par([ ]) abs fmt(3))) starlevels(* 0.1 ** 0.05 *** 0.01) ///
 stats(N r2, fmt(0 3 0) label("Observations" "R-squared"))  ///
 mlabels("[1]" "[2]" "[3]") //	
	

log close
	
*END
